import { stringify } from "qs";
import http from "~/utils/http";

export default {
  async query({ categoryId, title, abstract, status, page = 0, size = 40}) {
    try {
      let { data } = await http.get(`/api/cms/article?${stringify({ categoryId, title, abstract, status, page, size })}`)
      return data
    } catch (error) {
      return []
    }
  },

  async info({id}) {
    try {
      let { data } = await http.get(`/api/cms/article/${id}`)
      return data
    } catch (error) {
      return {}
    }
  }
};
